"""Definition of the multiproducts content type
"""

from zope.interface import implements

from Products.Archetypes import atapi
from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content import schemata

from my315ok.products import productsMessageFactory as _
from my315ok.products.interfaces import Imultiproducts
from my315ok.products.config import PROJECTNAME

multiproductsSchema = folder.ATFolderSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

))

# Set storage on fields copied from ATFolderSchema, making sure
# they work well with the python bridge properties.

multiproductsSchema['title'].storage = atapi.AnnotationStorage()
multiproductsSchema['description'].storage = atapi.AnnotationStorage()

schemata.finalizeATCTSchema(
    multiproductsSchema,
    folderish=True,
    moveDiscussion=False
)


class multiproducts(folder.ATFolder):
    """a product that contains multiple product materiales"""
    implements(Imultiproducts)

    meta_type = "multiproducts"
    schema = multiproductsSchema

    title = atapi.ATFieldProperty('title')
    description = atapi.ATFieldProperty('description')

    # -*- Your ATSchema to Python Property Bridges Here ... -*-

atapi.registerType(multiproducts, PROJECTNAME)
